package com.xqls.util;

import java.util.ArrayList;
import java.util.List;

public enum DictionaryEnums {
	COMPANY_TYPE(1, "设备类型"),ALARM_TYPE(10,"报警类型"),NET_WORK(20,"网络"),POWER_SUPPLY(23,"电源"),
    INSTRUMENT_DOOR(26,"仪表门"),OPERATION(29,"操作"),SAMPLING_INSTRUMENT(32,"采样仪"),LEVEL(33,"液位"),
    VALVE_OPERATION(34,"阀门操作"),EMERGENCY_PUMP(31,"应急池水泵"),OPEN_VALVE(45,"开阀门"),CLOSE_VALVE(46,"关阀门"),
    INTAKE(2,"取水口"),INTAKELIST(35,"取水口实时数据"),INTAKESAMPLING(36,"取水口采样记录"),
    DISCHARGE(3,"排放口"),DISCHARGELIST(37,"排放口实时数据"),DISCHARGESAMPLING(38,"排放口采样记录"),
    RAINWATER(4,"企业雨水排放口"),RAINWATERLIST(39,"企业雨水排放口实时数据"),RAINWATERSAMPLING(40,"企业雨水排放口采样记录"),
    STORMWATER(5,"公共雨水排放口"),STORMWATERLIST(41,"公共雨水排放口实时数据"),STORMWATERSAMPLING(42,"公共雨水排放口采样记录"),
    WASTEGAS(6,"废气排放口"),UNKNOW(7,"未设置类型的设备"),WASTERGASLIST(43,"废气排放口实时数据"),WASTERGASSAMPLING(44,"废气排放口采样记录"),
    SAMPLING_MODE(47,"采样方式"),NO_SAMPLING(48,"不采样"),MIXED_SAMPLING(49,"混合采样"),BOTTLE_SAMPLING(50,"分瓶采样"),
    MODE_PERIOD(202,"周期采样"),MODE_OVERPROOF(203,"超标采样"),MODE_IMMEDIATE(204,"及时采样"),EDIT_BOTTON(432,"修改权限"),ADD_BOTTON(433,"添加权限"),
    LEVEL_ONE_TIME(101,"一级报警持续分钟"),LEVEL_TWO_TIME(102,"一级报警持续分钟"),LEVEL_THREE_TIME(103,"一级报警持续分钟"),
    VALUE(104,"阀门故障"),MAINS(105,"电源异常"),NETWORK(106,"网络异常"),LIQUID_SITE(107,"液位异常"),DOOR(108,"监测房门开"),
	VESSEL_ONE(302,"一号采样瓶"),VESSEL_SECOND(303,"二号采样瓶"),VESSEL_THIRTH(304,"三号采样瓶"),VESSEL_FOURTH(305,"四号采样瓶"),
	VESSEL_FIRTH(306,"五号采样瓶"),VESSEL_SIXTH(307,"六号采样瓶"),VESSEL_SEVENTH(308,"七号采样瓶"),VESSEL_EIGTH(309,"八号采样瓶"),
	VESSEL_NINTH(310,"九号采样瓶"),VESSEL_TENTH(311,"十号采样瓶"),VESSEL_ELEVENTH(312,"十一号采样瓶"),VESSEL_TWELFTH(313,"十二号采样瓶"),
	LEVEL_ONE(402,"一级"),LEVEL_SECOND(403,"二级"),LEVEL_THIRTH(404,"三级"),REMOTE_TYPE(450,"采样模式"),START_MODE(470,"启动方式"),
	PERIODIC_SAMPLING(451,"周期采样"),WHOLE_POINT_SAMPLING(452,"整点采样"),FLOW_ACCUMULATION_SAMPLING(453,"流量累计采样"),
	INSTANTANEOUS_FLOW_TRIGGERING(454,"瞬时流量触发采样"),LEVEL_TRIGGER(455,"液位触发采样"),CONCENTRATION_TRIGGER(456,"浓度触发采样"),SINGLE_SAMPLE_IMMEDIATELY(457,"即时单次采样"),
    RESTART_NOW(471,"立即启动"),DELAYED_START(472,"延时启动"),
	VALVE_FAILURE(11,"阀门故障"),POWER_ANOMALY(12,"电源异常"),NETWORK_OFFLINE(13,"网络离线"),DOOR_OPEN(14,"监测房门开"),LEVEL_ANOMALY(15,"液位异常"),
	ALARM_STATUS(60,"报警状态"),ALARM(61,"报警"),ALARM_SOLVE(62,"报警已解决"),NO_ALARM(63,"未报警"),CONCENTRATION_SAMPLING(64,"浓度触发下采样方式"),N_SAMPLING(65,"不采样"),FIXED_SAMPLING(66,"固定采样"),PROPORTION_SAMPLING(67,"比例采样"),
	INTERVAL_TIME(150,"间隔时间");

    DictionaryEnums(Integer code, String msg) {
        this.code = code;
        this.msg=msg;
    }

    private Integer code;
    private String msg;
    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    /**
     * 根据编码查找枚举
     */
    public static DictionaryEnums find(int code) {
        for (DictionaryEnums frs : DictionaryEnums.values()) {
            if (frs.getCode().intValue() == code) {
                return frs;
            }
        }
        return null;
    }

    public static List<Integer> getLevelList(){
        List<Integer> keyList=new ArrayList<Integer>();

        keyList.add(DictionaryEnums.LEVEL_ONE.getCode());
        keyList.add(DictionaryEnums.LEVEL_SECOND.getCode());
        keyList.add(DictionaryEnums.LEVEL_THIRTH.getCode());

        return keyList;
    }

    public static List<Integer> getExampleModeList(){
        List<Integer> keyList=new ArrayList<Integer>();

        keyList.add(DictionaryEnums.MODE_PERIOD.getCode());
        keyList.add(DictionaryEnums.MODE_OVERPROOF.getCode());
        keyList.add(DictionaryEnums.MODE_IMMEDIATE.getCode());

        return keyList;
    }

    public static List<Integer> getExampleVesselList(){
        List<Integer> keyList=new ArrayList<Integer>();

        keyList.add(DictionaryEnums.VESSEL_ONE.getCode());
        keyList.add(DictionaryEnums.VESSEL_SECOND.getCode());
        keyList.add(DictionaryEnums.VESSEL_THIRTH.getCode());
        keyList.add(DictionaryEnums.VESSEL_FOURTH.getCode());
        keyList.add(DictionaryEnums.VESSEL_FIRTH.getCode());
        keyList.add(DictionaryEnums.VESSEL_SIXTH.getCode());
        keyList.add(DictionaryEnums.VESSEL_SEVENTH.getCode());
        keyList.add(DictionaryEnums.VESSEL_EIGTH.getCode());
        keyList.add(DictionaryEnums.VESSEL_NINTH.getCode());
        keyList.add(DictionaryEnums.VESSEL_TENTH.getCode());
        keyList.add(DictionaryEnums.VESSEL_ELEVENTH.getCode());
        keyList.add(DictionaryEnums.VESSEL_TWELFTH.getCode());

        return keyList;
    }

}
